﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RCloud.Data.List
{
    public class Movie
    {
        public long MovieID { get; set; }
    }

    public class TopMovieClass : Doo.DataClass.ListClass<REntities, Movie>
    {
        public long TagID { get; set; }

        public override IOrderedQueryable<Movie> GetQuery(REntities container)
        {
            var query = from rh in container.MovieTags
                        where rh.TagID == TagID
                        orderby rh.SumCount descending
                        select new Movie
                        {
                            MovieID = rh.MovieID
                        };
            return (IOrderedQueryable<Movie>)query;
        }
    }
}
